import Vue from 'vue'
import iView from 'iview'
import Router from 'vue-router'
import RouterConfig from './config'

Vue.use(Router)
let router = RouterConfig(Router)
router.beforeEach((to, from, next) => {
  iView.LoadingBar.start()
  next()
})

router.afterEach(route => {
  iView.LoadingBar.finish()
})

export default router
